Adds a check to vtpm_manager and vtpm Makefiles to verify openssl and
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 12 Jan 2006 13:27:20 +0000 (14:27 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 12 Jan 2006 13:27:20 +0000 (14:27 +0100)
gmp dev files are installed. If files are missing, Makefile exits with a
message indicating that these tools will not be built, rather than an
error, which prevents Xen from building.

Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
tools/vtpm/Makefile
tools/vtpm/Rules.mk
tools/vtpm_manager/Makefile

index a1c8aa6438867561e485b33435088258fad95b42..8224a9d3045afa27ac4d0f6914b43b1013bd065e 100644 (file)
@@ -11,6 +11,8 @@ VTPM_DIR = vtpm
 # Emulator tarball name
 TPM_EMULATOR_TARFILE = tpm_emulator-0.2b.tar.gz
 
+GMP_HEADER = /usr/include/gmp.h
+
 all: build
 
 build: $(TPM_EMULATOR_DIR) $(VTPM_DIR) build_sub
@@ -55,5 +57,12 @@ $(VTPM_DIR): $(TPM_EMULATOR_TARFILE)
        patch -p1 <../vtpm.patch
 
 build_sub:
-       $(MAKE) -C $(TPM_EMULATOR_DIR)
-       $(MAKE) -C $(VTPM_DIR)
+       if [ -e $(GMP_HEADER) ]; then \
+               $(MAKE) -C $(VTPM_DIR); \
+               if [ "$(BUILD_EMULATOR)" = "y" ]; then \
+                       $(MAKE) -C $(TPM_EMULATOR_DIR); \
+               fi \
+       else \
+               echo "*** Unable to build VTPMs. libgmp could not be found."; \
+       fi
+
index e840df141f32e0221b288ced13fa85705f33fdd4..93b84cdaa5c4f48bb6cf455bceedbf04bd5a2e18 100644 (file)
@@ -33,5 +33,7 @@ $(OBJS): $(SRCS)
 
 -include $(DEP_FILES)
 
+BUILD_EMULATOR = n
+
 # Make sure these are just rules
 .PHONY : all build install clean
index dddfa5160b313e3133ea558bcfaeeddaa4ea505e..16825a22793734ddfbfaa641cf85a1b8a2408235 100644 (file)
@@ -4,13 +4,18 @@ XEN_ROOT = ../..
 include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk
 
 SUBDIRS                = crypto tcs util manager
+OPENSSL_HEADER = /usr/include/openssl/crypto.h
 
 all: build
 
 build:
-       @set -e; for subdir in $(SUBDIRS); do \
-               $(MAKE) -C $$subdir $@; \
-       done
+       if [ -e $(OPENSSL_HEADER) ]; then \
+               @set -e; for subdir in $(SUBDIRS); do \
+                       $(MAKE) -C $$subdir $@; \
+               done; \
+       else \
+               echo "*** Cannot build vtpm_manager: OpenSSL developement files missing."; \
+       fi
 
 install: build
        @set -e; for subdir in $(SUBDIRS); do \